package day5;

import java.util.Scanner;

public class Year {

    private int year;
    private int month;
    private int day;

    public void runYear(int year) {
        if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) {

            System.out.printf("%d是闰年", year);

        } else {
            System.out.printf("%d不是闰年", year);

        }

    }


    //    public static void ifRun(){
//        System.out.println("请输入需要判断的年份");
//        Scanner sc=new Scanner(System.in);
//        int x=sc.nextInt();
//       if(x%4==0&&x%100!=0||x%400==0){
//           System.out.println(x+"年是闰年");
//       }else{
//           System.out.println(x+"年不是闰年");
//       }
//    }
    public String toString() {

        return year + "年" + month + "月" + day + "日";
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }
}
//    public int getYear(){
//        return year;
//    }
//
//    public void setYear(int year){
////        System.out.println(year);
//        if(year<2024){
//            this.year = year;
//        }else{
//            System.out.println("年份输入不正确");
//        }
//    }
//    public void setMonth(int month){
////        System.out.println(month);
//        if(1<=month&&month<=12){
//            this.month = month;
//        }else{
//            System.out.println("月份输入不正确");
//        }
//    }
//    public void setDay(int day){
////        System.out.println(day);
//        if(1<=day&&day<=31){
//            this.day = day;
//        }else{
//            System.out.println("日期输入不正确");
//        }
//    }
//    public int show(){
////        System.out.println("年:"+this.year+"月:"+this.month+"日:"+this.day);
//        return this.year+this.month+this.day;
//    }
//}
